package tpf.designer.pattern.course5.structure_pattern2.flyweight_13.simple_2;


import org.apache.log4j.Logger;

/**
 * 不需要共享的flyweight对象，
 * 通常是将被共享的享元对象作为子节点，组合出来的对象
 */
public class UnsharedConcreteFlyweight implements Flyweight{

    public static final Logger LOGGER = Logger.getLogger(UnsharedConcreteFlyweight.class);

    /**
     * 示例，描述对象的状态
     */
    private String allState;

    public UnsharedConcreteFlyweight(String allState) {
        this.allState = allState;
    }

    public void operation(String extrinsicState) {
        // 具体的功能处理
        LOGGER.info("不需要共享的flyweight对象");
        LOGGER.info("\n 内蕴状态：" + allState + ", 外蕴状态：" + extrinsicState);
    }
}